export default {
  setHeaderTitle(state, RouterName) {
    switch (RouterName) {
      case ' index':
        state.headerTitle = '驾照题库'
        break
      case 'test':
        state.headerTitle = '开始做题'
        break
      case 'result':
        state.headerTitle = '答题结果'
    }
  },
  setSubjectId(state, id) {
    state.subjectId = id
  },
  setModel(state, type) {
    state.modelType = type
  },
  setData(state, data) {
    state.data = data
    state.quest = state.data[0]
  },
  setErrorCode(state, code) {
    state.errorCode = code
  },
  setQuestion(state, num) {
    state.quest = state.data[num]
  },
  setQuestionPosition(state) {
    state.questionPosition++
  },
  setMyAnswer(state, obj) {
    state.MyAuswer.push(obj)
  },
  resetPosition(state) {
    state.questionPosition = 1
  },
  setIndex(state, num) {
    state.Mdin = num
  }
}
